#ifndef GENERATE_CODE_H
#define GENERATE_CODE_H

#include <stdint.h>
#include <stdio.h>

typedef enum reg_no { RAX, RBX, RCX, RDX, RDI, RSI, R8, R9, R10, R11, R12, R13, R14, R15, REG_MAX } REG_NO;

size_t rdpmc(uint8_t *dst);
size_t rdtsc(uint8_t *dst);
size_t lfence(uint8_t *dst);

size_t mov_reg_imm32(uint8_t *dst, REG_NO reg, uint32_t imm32);
size_t mov_reg_imm64(uint8_t *dst, REG_NO reg, uint64_t imm64);

size_t dec_reg(uint8_t *dst, REG_NO reg);
size_t jnz_imm32(uint8_t *dst, uint32_t offset);
size_t shl_rdx_imm8(uint8_t *dst, uint8_t offset);
size_t splice_rdx_rax(uint8_t *dst);
size_t sub_rdx_rax_to_r15(uint8_t *dst, uint8_t offset);
size_t add_rdx_rax_to_r15(uint8_t *dst, uint8_t offset);
size_t reg_push(uint8_t *dst);
size_t reg_pop(uint8_t *dst);

#endif  // GENERATE_CODE_H
